package com.zjitc.CountDown;

import javax.servlet.ServletContextEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/17 16:26
 * @description:
 */
public class SpringInit {
  private static WebApplicationContext springContext;
  public SpringInit() {
    super();
  }
  public void contextInitialized(ServletContextEvent event) {
    springContext = WebApplicationContextUtils.getWebApplicationContext(event.getServletContext());
  }

  public void contextDestroyed(ServletContextEvent event) {

  }

  public static ApplicationContext getApplicationContext() {
    return springContext;
  }

}
